package org.monster.context.core.request;

import org.monster.context.core.parameter.HttpResponse;

/**
 * 请求上下文
 *
 * @author Monster
 */
public class RequestContext {

    /**
     * 处理工厂
     */
    private RequestFactory factory = new RequestFactory();

    /**
     * 处理
     *
     * @param method   方法
     * @param request  请求
     * @param response 响应
     */
    public void process(String method, HttpRequest request,
                        HttpResponse response) {
        Request process = factory.getInstance(method);
        if (process != null) {
            process.process(request, response);
        }
    }
}
